<template>
  <div class="error-page">
    <div class="error-content">
      <div class="error-code">404</div>
      <div class="error-desc">抱歉，您访问的页面不存在</div>
      <div class="error-detail">
        <p>可能的原因：</p>
        <ul>
          <li>网址输入错误</li>
          <li>页面已被移除</li>
          <li>服务器暂时无法访问</li>
        </ul>
      </div>
      <div class="error-actions">
        <el-button type="primary" @click="goHome">返回首页</el-button>
        <el-button @click="refresh">刷新页面</el-button>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'NotFound',
  setup() {
    const router = useRouter()
    
    const goHome = () => {
      router.push('/')
    }

    const refresh = () => {
      window.location.reload()
    }
    
    return {
      goHome,
      refresh
    }
  }
})
</script>

<style lang="scss" scoped>
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #f0f2f5;
  
  .error-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
    
    .error-code {
      font-size: 120px;
      font-weight: bold;
      color: #409EFF;
      margin-bottom: 20px;
      line-height: 1;
    }
    
    .error-desc {
      font-size: 24px;
      color: #303133;
      margin-bottom: 30px;
    }

    .error-detail {
      margin-bottom: 30px;
      color: #606266;
      
      p {
        margin-bottom: 10px;
        font-weight: bold;
      }
      
      ul {
        list-style: none;
        padding: 0;
        
        li {
          margin: 5px 0;
        }
      }
    }
    
    .error-actions {
      .el-button {
        margin: 0 10px;
      }
    }
  }
}
</style> 